package mymodel

type MqttConnectOption struct {
	Tag           int      `json:"tag"  yaml:"tag"` // 0 emqx 1 mochi
	Protocol      string   `json:"protocol"`        // http 或者 https  代表是否加密 默认http
	Host          string   `json:"host"`
	PublicHost    string   `json:"publicHost"`
	Port          int      `json:"port"`
	User          string   `json:"user"`
	Password      string   `json:"password"`
	ClientId      string   `json:"clientId"`
	Topics        []string `json:"topics"` //订阅哪些主题
	ApiUser       string   `json:"apiUser"  yaml:"apiUser"`
	ApiPassword   string   `json:"apiPassword"  yaml:"apiPassword"`
	ApiPort       int      `json:"apiPort"  yaml:"apiPort"`
	WebsocketPort int      `json:"websocketPort"  yaml:"websocketPort"`
}

type EmqxPublishOps struct {
	Retained   bool   `json:"retained"`
	ConfigType string `json:"configType"`
	MustOnline bool   `json:"mustOnline"`
}

type DeviceTmpMqttMsgInfo struct {
	DeviceNo string          `json:"deviceNo"`
	Aetype   string          `json:"aetype"`
	Data     []byte          `json:"data"`
	Ops      *EmqxPublishOps `json:"ops"`
}

type EmqxApiClientOnlineResult struct {
	Data []struct {
		RecvMsgQos2             int    `json:"recv_msg.qos2"`
		MaxAwaitingRel          int    `json:"max_awaiting_rel"`
		IsBridge                bool   `json:"is_bridge"`
		MaxMqueue               int    `json:"max_mqueue"`
		SendMsgQos0             int    `json:"send_msg.qos0"`
		CreatedAt               string `json:"created_at"`
		SendMsgDroppedTooLarge  int    `json:"send_msg.dropped.too_large"`
		Zone                    string `json:"zone"`
		AwaitingRel             int    `json:"awaiting_rel"`
		RecvOct                 int    `json:"recv_oct"`
		SubscriptionsCnt        int    `json:"subscriptions_cnt"`
		Mountpoint              string `json:"mountpoint"`
		Connected               bool   `json:"connected"`
		RecvMsgQos1             int    `json:"recv_msg.qos1"`
		SenDMsgDroppedExpired   int    `json:"sen d_msg.dropped.expired"`
		RecvMsgQos0             int    `json:"recv_msg.qos0"`
		SendMsgQos1             int    `json:"send_msg.qos1"`
		MqueueDropped           int    `json:"mqueue_dropped"`
		SendMsgQos2             int    `json:"send_msg.qos2"`
		SendOct                 int    `json:"send_oct"`
		Inflight                int    `json:"inflight"`
		SendMsg                 int    `json:"send_msg"`
		ConnectedAt             string `json:"connected_at"`
		MailboxLen              int    `json:"mailbox_len "`
		RecvMsg                 int    `json:"recv_msg"`
		ExpiryInterval          int    `json:"expiry_interval"`
		SendMsgDroppedQueueFull int    `json:"send_msg.dropped.queue_full"`
		Reductions              int    `json:"reductions"`
		RecvCnt                 int    `json:"recv_cnt"`
		Clientid                string `json:"clientid"`
		CleanStart              bool   `json:"clean_start"`
		Port                    int    `json:"port"`
		RecvPkt                 int    `json:"recv_pkt"`
		RecvMsgDroppEd          int    `json:"recv_msg.dropp ed"`
		SendCnt                 int    `json:"send_cnt"`
		SendMsgDropped          int    `json:"send_msg.dropped"`
		IpAddress               string `json:"ip_address"`
		MaxSubscriptions        int    `json:"max_subscriptions"`
		Keepalive               int    `json:"keepalive"`
		Node                    string `json:"node"`
		ProtoVer                int    `json:"proto_ver"`
		SendPkt                 int    `json:"send_pkt"`
		HeapSize                int    `json:"heap_size"`
		MqueuELen               int    `json:"mqueu e_len"`
		MaxInflight             int    `json:"max_inflight"`
		ProtoName               string `json:"proto_name"`
		Username                string `json:"username"`
	} `json:"data"`
	Code int `json:"code"`
}
